package com.kyh.entity;

import javax.persistence.Table;


import java.util.Date;

import com.kyh.annotation.Model;
import com.kyh.entity.base.BaseEntity;

/**
*/
@Table(name="item")
public class Item extends BaseEntity<Item> {

	@Model(nameTable="id")
	private Long id; // 主键ID
	@Model(nameTable="templetId")
	private Long templetId; // 模板ID
	@Model(nameTable="pid")
	private Long pid; // 上级栏目ID，一级栏目默认为0
	@Model(nameTable="lev")
	private Integer lev; // 栏目等级，1一级栏目2二级栏目
	@Model(nameTable="name")
	private String name; // 栏目名称
	@Model(nameTable="sortno")
	private Integer sortno; // 排列序号
	@Model(nameTable="status")
	private Integer status; // 
	@Model(nameTable="createTime",type=Model.TYPE.DATE, format="yyyy-MM-dd HH:mm:ss")
	private Date createTime; // 
	@Model(nameTable="updateTime",type=Model.TYPE.DATE, format="yyyy-MM-dd HH:mm:ss")
	private Date updateTime; // 

	public Long getId() {
		return id;
	}
	public Item setId(Long id) {
		this.id = id;
		return this;
	}
	public Long getTempletId() {
		return templetId;
	}
	public Item setTempletId(Long templetId) {
		this.templetId = templetId;
		return this;
	}
	public Long getPid() {
		return pid;
	}
	public Item setPid(Long pid) {
		this.pid = pid;
		return this;
	}
	public Integer getLev() {
		return lev;
	}
	public Item setLev(Integer lev) {
		this.lev = lev;
		return this;
	}
	public String getName() {
		return name;
	}
	public Item setName(String name) {
		this.name = name;
		return this;
	}
	public Integer getSortno() {
		return sortno;
	}
	public Item setSortno(Integer sortno) {
		this.sortno = sortno;
		return this;
	}
	public Integer getStatus() {
		return status;
	}
	public Item setStatus(Integer status) {
		this.status = status;
		return this;
	}
	public Date getCreateTime() {
		return createTime;
	}
	public Item setCreateTime(Date createTime) {
		this.createTime = createTime;
		return this;
	}
	public Date getUpdateTime() {
		return updateTime;
	}
	public Item setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
		return this;
	}

	public static Item item(
			Long templetId,
			Long pid,
			Integer lev,
			String name,
			Integer sortno,
			Integer status
			) {
		Item entity = new Item();
		entity.setTempletId(templetId);
		entity.setPid(pid);
		entity.setLev(lev);
		entity.setName(name);
		entity.setSortno(sortno);
		entity.setStatus(status);
		return entity;
	}
}